#!/usr/bin/env node
const log = console.log;

const msg = ['name','email','qq','mobile'];
const me = {}

let num = 0;
process.stdout.write(msg[num]+':');
//process.stdin.on('event name','fn')//on处理事件
process.stdin.on('data',(data)=>{
        me[msg[i-1]]=data.slice(0,data.length - 1).toString('utf8');
        if(num < msg.length) {
            process.stdout.write(msg[num]+':')
    }else{
        process.stdout.write('')
    }
});
process.stdin.on('end',()=>{
    console.log(me);
    process.exit()});
//ctrl+D->退出


